export function handleTree(data) {
  const targetData = []
  const map = {}
  data.forEach((item) => {
    map[item.id] = item
    item.children = []
  })
  data.forEach((item) => {
    if (map[item.pid]) {
      map[item.pid].children.push(item)
    } else {
      targetData.push(item)
    }
  })
  return targetData
}
